﻿using System;
using System.Linq.Expressions;

using Fuse8.DomainFramework.Domain;

namespace Fuse8.DomainFramework.BusinessService
{
    /// <summary>
    /// 
    /// </summary>
    public class SortableQueryLibraryProperty<TEntity, TKey, TSortKey>
        where TEntity : class, IEntityObject<TKey>, new()
        where TKey : IComparable<TKey>, IEquatable<TKey>
        where TSortKey : IComparable<TSortKey>
    {
        /// <summary>
        /// 
        /// </summary>
        public Expression<Func<TEntity, TSortKey>> SortExpression { get; protected set; }

        /// <summary>
        /// 
        /// </summary>
        public SortDirection SortDirection { get; protected set; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sortExpression"></param>
        /// <param name="sortDirection"></param>
        public SortableQueryLibraryProperty(Expression<Func<TEntity, TSortKey>> sortExpression, SortDirection sortDirection)
        {
            SortExpression = sortExpression;
            SortDirection = sortDirection;
        }
    }
}
